<?php
namespace app\api\controller;
use app\api\utils\Utils;

class Mine 
{
    //我的信息
    public function getUserInfo ()
    {
        $field = ['token'];
        $data = [
            'userName' => 'hellowx',
            'personNO' => '5134515135431513135',
            'userMobile'    => '18312456948',
            'nickName' => 'Trymybest',
            'headImg'  => '/uploads/images/1612522R8-4.jpg',
            'birthday' => '1993-11-12',
        ];

        return Utils::validateRequestMethod(['post', 'get'])
            ->validateParams(true, [])
            ->response($data);
    }

    //我的收藏
    public function collectionLists ()
    {
        $field = ['token'];
        $data = [
            [
                'productName' => '云南大理蝴蝶泉',
                'productCode'  => '213425',
                'starts' => 3.5,
                'imgPath' => '/uploads/images/9277bb32f2e549a580550204431b0a54_R_1600_10000_Mtg_7.jpg',
                'productDec' => '动植物的天堂，心灵的冲击波',
                'mapX'=>'30.654453', 
                'mapY'=>'104.072113',
                'showPrice' => "128.00",
            ],
            [
                'productName' => '苍山洗马潭索道',
                'productCode'  => '213425',
                'starts' => 3.5,
                'imgPath' => '/uploads/images/9277bb32f2e549a580550204431b0a54_R_1600_10000_Mtg_7.jpg',
                'productDec' => '动植物的天堂，心灵的冲击波',
                'mapX'=>'30.654453', 
                'mapY'=>'104.072113',
                'showPrice' => "128.00",
            ],
            [
                'productName' => '云南崇圣寺三塔',
                'productCode'  => '213425',
                'starts' => 3.5,
                'imgPath' => '/uploads/images/CghzfFWwqDiAFQtgAAhcsJYs-b0709_R_1600_10000_Mtg_7.jpg',
                'productDec' => '动植物的天堂，心灵的冲击波',
                'mapX'=>'30.654453', 
                'mapY'=>'104.072113',
                'showPrice' => "128.00",
            ],
            [
                'productName' => '云南大理洱海',
                'productCode'  => '213425',
                'starts' => 3.5,
                'imgPath' => '/uploads/images/529218b2e4a94089a5ad80f66dfefef5_C_1600_1200_Mtg_7.jpg',
                'productDec' => '动植物的天堂，心灵的冲击波',
                'mapX'=>'30.654453', 
                'mapY'=>'104.072113',
                'showPrice' => "128.00",
            ],
            [
                'productName' => '云南感通索道',
                'productCode'  => '213425',
                'starts' => 3.5,
                'imgPath' => '/uploads/images/9277bb32f2e549a580550204431b0a54_R_1600_10000_Mtg_7.jpg',
                'productDec' => '动植物的天堂，心灵的冲击波',
                'mapX'=>'30.654453', 
                'mapY'=>'104.072113',
                'showPrice' => "128.00",
            ],
        ];

        return Utils::validateRequestMethod(['post', 'get'])
            ->validateParams(true, [])
            ->response($data, ['total'=>5]);
    }

    //取消收藏
    public function cancelCollection ()
    {
        $field = ['token', 'businessCode'];
        $data = ['取消成功'];

        return Utils::validateRequestMethod(['post'])
            ->validateParams(true, [])
            ->response($data);
    }

    //修改昵称
    public function updateNickname ()
    {
        $field = ['token', 'nickName'];

        return Utils::validateRequestMethod(['post'])
            ->validateParams(true, [])
            ->response();
    }

    //修改信息
    public function updateBirthday ()
    {
        $field = ['token', 'birthday'];

        return Utils::validateRequestMethod(['post'])
            ->validateParams(true, [])
            ->response();
    }

    //修改信息
    public function updateHeadImg ()
    {
        $field = ['token', 'headImg'];

        return Utils::validateRequestMethod(['post'])
            ->validateParams(true, [])
            ->response();
    }

    //退出
    public function logout ()
    {
        $field = ['token'];

        return Utils::validateRequestMethod(['post'])
            ->validateParams(true, [])
            ->response();
    }


}